package com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler;

import com.example.design.patterns.冰河.行为模式.责任链模式.handler.Request;
import com.example.design.patterns.冰河.行为模式.责任链模式.handler.RequestHandle;

public class PMRequestHandle implements RequestHandle {
    RequestHandle requestHandle;

    public PMRequestHandle(RequestHandle requestHandle) {
        this.requestHandle = requestHandle;
    }

    /**
     *
     * @param request
     */
    @Override
    public void handleRequest(Request request) {
        if (request instanceof AddMoneyRequest) {
            System.out.println("要加薪水,项目经理审批!");
        } else {
            requestHandle.handleRequest(request);
        }
    }
}
